import socket
import sys

print "Welcome to drazaH, please select an option."
print "1: Start new game."
print "2: Change player name."
print "3: Options."
print "4: Close."
y = raw_input ()   

i = 0
while i < 10:
    if y == "1":
        i = 10
        #break
    elif y == "2":
        print "Not yet available"
        i = 0
        y = raw_input()
    elif y == "3":
        print "Not yet available"
        i = 0
        y = raw_input()
    elif y == "4":
        quit()
    #else:
     #   print "Please enter 1-4"
    


host = '127.0.0.1'
port = 1234
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((host,port))
print 'Connected to server... type a message'
while 1:
    x = raw_input()
    s.send(x)
    #s.send('hello')
    data = s.recv(1024)
    #s.close()
    print 'Echo:' , repr(data)
    if x == "stop":
        break

s.close()
print "connection closed"     

    
